<!--工程划分 编辑-->
<template>
  <div class="department" id="pages">
    <!-- 左侧部门管理 -->
    <div class="structureTree">
      <div class="structureTree_title">
        <div>组织机构</div>
        <div>
          <el-checkbox v-model="checked">查看下级</el-checkbox>
        </div>
      </div>
      <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick" node-key="F_CompanyId"
        :accordion="true" :expand-on-click-node="false" :default-expanded-keys="expandedKeys"></el-tree>
    </div>
    <!-- 右侧 -->
    <div class="department_right">
      <!-- 部门信息 -->
      <div class="department_right_name">
        <div>
          {{ positionName }}
        </div>
      </div>

      <!-- 顶部导航栏 -->
      <div class="mechanism_nav">
        <!-- 左侧 -->
        <div class="mechanism_nav_left">
          <!-- <input type="text" placeholder="请输入关键字" /> -->
        <!-- <el-button type="primary" size="small" @click="getDataList(companyId)"
            >工程编号刷新</el-button
                    > -->
        </div>
        <!-- 右侧 -->
        <div class="print">
          <div class="printTable">
            <el-button type="primary" icon="el-icon-refresh" size="small" @click="getDataList(companyId)"></el-button>
            <el-button type="primary" icon="el-icon-search" size="small" @click="getCheckList(fId)">查看</el-button>
          </div>
        </div>
      </div>

      <!-- 表格 -->
      <div class="text_table">
        <el-table ref="multipleTable" :data="tableData5" style="width: 100%" 
          :height="navigatepageNums > 1 ? 'calc(100% - 50px)' : '100%'"
         border default-expand-all
          :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" row-key="F_CompanyId" v-loading="loading"
          element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)" @row-click="getRowInfo1" stripe highlight-current-row
          @current-change="handleCurrentChange">
          <el-table-column fixed type="index" label="" width="50" align="center"></el-table-column>
          <el-table-column prop="F_CompanyId" label="工程编号" width="200"></el-table-column>
          <el-table-column prop="F_ShortName" label="工程名称" width="180"></el-table-column>
          <el-table-column prop="F_Nature" label="工程类别" width="90">
          </el-table-column>
          <el-table-column prop="cous" label="回弹任务数" width="90" align="center">
          </el-table-column>
          <el-table-column prop="iscous" label="已完成回弹任务数" width="120" align="center">
          </el-table-column>
          <el-table-column prop="price" label="完成率" width="90" align="center">
          </el-table-column>
          <el-table-column prop="isHave" label="检测记录" width="75" align="center">
            <template slot-scope="scope">
              <el-button @click="openDialog1(scope.row)" @cell-dblclick="openDialog1" type="text" size="small"
                v-if="scope.row.isHave > 0">
                查看
              </el-button>
            </template>
          </el-table-column>

          <el-table-column label="编辑" width="90" v-if="edit" align="center">
            <template slot-scope="scope" >
              <el-button size="mini" type="text" @click="handleEdit(scope.$index, scope.row)">新增</el-button>
              <el-button @click.native.prevent="deleteRow(scope.row, index)" size="mini" type="text">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <!-- 查看弹框 -->
    <div class="pdfWidth">
      <el-dialog title="查看" v-dialogDrag :close-on-click-modal="false" :visible.sync="dialogCheckVisible"
        v-loading="loadingCheckDialog" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.2)">
        <el-menu :default-active="activeIndexs" class="el-menu-demo" mode="horizontal">
          <el-menu-item index="1">记录报告信息1</el-menu-item>
          <!-- <el-menu-item index="2">实测回弹值信息</el-menu-item> -->
        </el-menu>
        <div v-if="activeIndexs == 1" class="dialogBody" style="margin-top: 10px" :style="{ height: dialogHeight }">
          <el-table ref="multipleTable" v-loading="loading" element-loading-text="拼命加载中"
            element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.2)"
            @row-click="getRowInfo" :data="CheckList" style="width: 100%" height="300" stripe border>
            <el-table-column fixed type="index" width="30" align="center">
            </el-table-column>
            <el-table-column prop="F_ProjectName" label="建设项目简称" width="160" align="left">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.F_ProjectName">{{
                    scope.row.F_ProjectName
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="F_CompanyName" label="施工标段简称" width="110">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.F_CompanyName">{{
                    scope.row.F_CompanyName
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="F_ReportNo" label="报告编号" width="175" align="center">
              <template slot-scope="scope">
                <el-button @click="openDialog(scope.row)" @cell-dblclick="openDialog" type="text" size="small">
                  {{ scope.row.F_ReportNo }}
                </el-button>
              </template>
            </el-table-column>
            <el-table-column prop="F_TestDate" label="报告日期" width="90" align="center">
            </el-table-column>
            <el-table-column prop="F_SamplingNo" label="样品编号" width="160" align="center">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.F_SamplingNo">{{
                    scope.row.F_SamplingNo
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="F_MarkNo" label="记录编号" width="160" align="center">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.F_MarkNo">{{
                    scope.row.F_MarkNo
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="F_MarkNo" label="工程部位/用途" width="170" align="left">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.F_ProjectTypeName">{{
                    scope.row.F_ProjectTypeName
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="F_TestDate" label="试验检测日期" width="100" align="center">
            </el-table-column>
            <el-table-column prop="F_TestNote" label="检测依据" width="110" align="center">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.F_TestNote">{{
                    scope.row.F_TestNote
                  }}</a>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="F_JudgeType" label="判定依据" align="center" width="120">
              <template slot-scope="scope">
                <div class="lineBoxhidden">
                  <a href="javascript:;" :title="scope.row.F_JudgeType">{{
                    scope.row.F_JudgeType
                  }}</a>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div v-if="activeIndexs == 2" class="dialogBody" :style="{ height: dialogHeight }"></div>
      </el-dialog>
    </div>
    <!-- 详情弹框 -->
    <div class="ProjectPage2">
      <el-dialog title="查看"  v-dialogDrag  :visible.sync="dialogTableVisibled" v-loading="loadingDialog1" element-loading-text="拼命加载中"
        element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.2)">
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
          <el-menu-item index="1">记录报告信息2222</el-menu-item>
          <el-menu-item index="2">实测回弹值信息</el-menu-item>
        </el-menu>
        <!-- 表1 -->
        <div v-if="activeIndex == 1" class="dialogBody common" :style="{ height: dialogHeightsa }">
          <div class="printTables">
          <!-- <el-button type="primary" size="small" @click="printFile('0')"
            >打印检测记录表</el-button
          >
          <el-button type="primary" size="small" @click="printFile('1')"
            >打印强度检测报告</el-button
                    > -->
          </div>
          <el-form :model="formData" :disabled="true">
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="检测类型" :label-width="formLabelWidth">
                <el-input v-model="formData.fChecktype" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="检测单位" :label-width="formLabelWidth">
                <el-input v-model="formData.fLeadercompanyname" autocomplete="off"></el-input>
              </el-form-item>
            </div>

            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="施工/委托单位" :label-width="formLabelWidth">
                <el-input v-model="formData.fCompanyname" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="工程名称" :label-width="formLabelWidth">
                <el-input v-model="projectName" autocomplete="off"></el-input>
              </el-form-item>
            </div>

            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="样品编号" :label-width="formLabelWidth">
                <el-input v-model="formData.fSamplingno" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="样品名称" :label-width="formLabelWidth">
                <el-input v-model="formData.fSamplename" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="主要仪器设备及编号" :label-width="formLabelWidth">
                <el-input v-model="formData.fEquipmentname" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="试验条件" :label-width="formLabelWidth">
                <el-input v-model="formData.fTesttype" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="记录编号" :label-width="formLabelWidth">
                <el-input v-model="formData.fMarkno" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="工程部位/用途" :label-width="formLabelWidth">
                <el-input v-model="formData.fProjecttypename" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="样品描述" :label-width="formLabelWidth">
                <el-input v-model="formData.fSamplespecs" autocomplete="off"></el-input>
              </el-form-item>
            </div>

            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="试验检测日期" :label-width="formLabelWidth">
                <el-input v-model="formData.fTestdates" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="检测依据" :label-width="formLabelWidth">
                <el-input v-model="formData.fTestnote" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="判定依据" :label-width="formLabelWidth">
                <el-input v-model="formData.fJudgetype" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="龄期(d)" :label-width="formLabelWidth">
                <el-input v-model="formData.fSpecimenage" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="设计强度等级" :label-width="formLabelWidth">
                <el-input v-model="formData.fConcretelevel" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="报告人" :label-width="formLabelWidth">
                <el-input v-model="formData.fModifyusername" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="报告日期" :label-width="formLabelWidth">
                <el-input v-model="formData.fReportdates" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="报告编号" :label-width="formLabelWidth">
                <el-input v-model="formData.fReportno" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="是否合格" :label-width="formLabelWidth">
                <el-input v-model="formData.fIstrue" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="检测结论" :label-width="formLabelWidth">
                <el-input v-model="formData.fTestresult" autocomplete="off"></el-input>
              </el-form-item>
            </div>

            <el-form-item label="附加说明" :label-width="formLabelWidth">
              <el-input v-model="formData.fNote" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <!-- 表2 -->
        <div v-if="activeIndex == 2" class="dialogBody" :style="{ height: dialogHeights }">
          <el-form :model="form" :disabled="true" style="margin-top: 10px !important">
            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="测区强度换算表" :label-width="formLabelWidth">
                <el-input v-model="formData.fConcretetype" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="实测数量（测区）" :label-width="formLabelWidth">
                <el-input v-model="formData.fTestnum" autocomplete="off"></el-input>
              </el-form-item>
            </div>

            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="回弹测试方向" :label-width="formLabelWidth">
                <el-input v-model="formData.fDirection" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="标准差S(MPa)" :label-width="formLabelWidth">
                <el-input v-model="formData.fStandarddeviation" autocomplete="off"></el-input>
              </el-form-item>
            </div>

            <div style="display: flex; width: 100%; height: 30px">
              <el-form-item label="检测浇筑面" :label-width="formLabelWidth">
                <el-input v-model="formData.fSurface" autocomplete="off"></el-input>
              </el-form-item>
              <el-form-item label="混凝土强度推定值" :label-width="formLabelWidth">
                <el-input v-model="formData.fConcreteresult" autocomplete="off"></el-input>
              </el-form-item>
            </div>
            <el-table ref="multipleTable1" :data="formData.checkConcretesampleitems"
              style="width: 100%; margin: 10px 0 0 5px" height="530" stripe border class="dialogBody1">
              <el-table-column fixed type="index" width="30" align="center">
              </el-table-column>
              <el-table-column prop="fDetectionangle" label="检测角度" align="center">
              </el-table-column>
              <el-table-column prop="fCarbonizationdepth" label="碳化深度" align="center">
              </el-table-column>
              <el-table-column prop="fParam1" label="01" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam2" label="02" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam3" label="03" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam4" label="04" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam5" label="05" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam6" label="06" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam7" label="07" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam8" label="08" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam9" label="09" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam10" label="10" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam11" label="11" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam12" label="12" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam13" label="13" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam14" label="14" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam15" label="15" :width="tableWidth" align="center">
              </el-table-column>
              <el-table-column prop="fParam16" label="16" :width="tableWidth" align="center">
              </el-table-column>
            </el-table>

            <el-table :data="formData.checkConcretesampleresult" style="width: 100%; margin: 10px 0 0 5px" height="480"
              stripe border>
              <el-table-column fixed type="index" width="25" align="center">
              </el-table-column>
              <el-table-column prop="fNote" label="测区"> </el-table-column>
              <el-table-column prop="fResult1" label="01" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult2" label="02" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult3" label="03" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult4" label="04" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult5" label="05" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult6" label="06" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult7" label="07" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult8" label="08" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult9" label="09" :width="tableWidth1" align="center">
              </el-table-column>
              <el-table-column prop="fResult10" label="10" :width="tableWidth1" align="center">
              </el-table-column>
            </el-table>
          </el-form>
        </div>
      </el-dialog>
    </div>
    <!-- 新增 -->
    <div class="newlyAdded">
      <el-dialog title="新增" v-dialogDrag :visible.sync="dialogNewAdd" element-loading-background="rgba(0, 0, 0, 0.2)">
        <div v-if="activeIndexs == 1" class="dialogBody common" style="margin-top: 22px"
          :style="{ height: dialogHeight }">
          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
            <el-form-item label="单位工程名称" prop="name">
              <el-input v-model="ruleForm.name"></el-input>
            </el-form-item>

            <el-form-item label="新增工程类别" prop="region">
              <el-select v-model="ruleForm.region" placeholder="请选择工程类别">
                <el-option label="子单位工程" value="shanghai"></el-option>
                <el-option label="分部工程" value="beijing"></el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="新增工程名称" prop="newName">
              <el-input v-model="ruleForm.newName"></el-input>
            </el-form-item>

            <el-form-item class="newlyAdded_btn">
              <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
              <!-- <el-button type="danger" @click="resetForm('ruleForm')">关闭</el-button> -->

              <el-button type="warning" @click="resetForm('ruleForm')">重置</el-button>
            </el-form-item>
          </el-form>
        </div>
        <div v-if="activeIndexs == 2" class="dialogBody" :style="{ height: dialogHeight }"></div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
// import StructureTree from "@/components/public/structureTree.vue";
export default {
  components: {
    // StructureTree,
  },
  data() {
    return {
      name: "ProjectPageText",
      yj_add: null,//新增按钮是否显示
      yj_edit: null,//编辑按钮是否显示
      yj_view: null,//查看按钮是否显示
      yj_delete: null,

      // 新增表单
      ruleForm: {
        name: "",
        region: "",
        newName: "",
      },
      rules: {
        name: [
          { required: true, message: "请输入单位工程名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        region: [
          { required: true, message: "请选择工程类别", trigger: "change" },
        ],
        newName: [
          { required: true, message: "请输入新增工程名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
      },
      edit: false, //编辑框显示隐藏
      checked: false, //查看下级
      positionName: "未选择公司",
      dialogHeight: "",
      dialogHeights: "",
      activeIndexs: "1",
      fFileName: "",
      activeIndex: "1",
      tableWidth: "35",
      tableWidth1: "55",
      expandedKeys: null,
      fId: null, //当前数据fId
      projectName: null, //项目名称
      loading: false,
      CheckList: [], //检测记录
      tableData5: [],
      fIds: null,
      fPhotofilelist: [], //检测记录表文件集合
      fSourcefilelist: [], //强度检测报告文件集合

      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      dialogTableVisible: false,
      dialogTableVisibled: false,
      dialogPdf: false,
      pdfUrl: "",

      loadingDialog1: false,
      dialogCheckVisible: false,
      loadingCheckDialog: false, //查看
      // loadingNewAdd: false, //新增
      dialogNewAdd: false,
      dialogFormVisible: false,

      formData: {},
      formLabelWidth: "70px",
      treeData: [],
      tableDatas: [],
      tableData: [],
      defaultProps: {
        children: "children",
        label: "F_ShortName",
      },
      dialogVisible: false,
      companyId: null,
      loadingDialog: false,
      currentRow: "",
    };
  },
  mounted() {
    this.getHeight();
    this.getTree();
  },
  methods: {
    // 新增
    handleEdit(index, row) {
      console.log(index, row);
      this.tableData5.push(index, 1);
      // this.loadingNewAdd = true;
      this.dialogNewAdd = true;
    },
    // 创建
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          return false;
        }
      });
    },
    // 重置
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },

    // 删除行
    deleteRow(rows, index) {
      this.tableData5.splice(index, 1);
    },

    async getTree() {
      this.loading = true;
      // this.dataList.projectId = this.projectId;
      const { data: res } = await this.$http.post("roadApi/companyList.do", {});
      if (res.errcode == 0) {
        this.loading = false;
        var companyTree = res.data.companyList;
        this.treeData = this.commonJs.tranListToTreeData(companyTree);

        this.expandedKeys = [this.treeData[0].F_CompanyId];
        this.companyId = this.treeData[0].F_CompanyId;
        this.getDataList(this.treeData[0].F_CompanyId);
      } else {
        this.$message.error(res.msg);
        this.loading = false;
      }
    },

    tranListToTreeData1(data) {
      let result = [];
      if (!Array.isArray(data)) {
        return result;
      }
      // 清除已存在的children 重新赋值
      data.forEach((item) => {
        delete item.children;
      });

      let map = {};
      data.forEach((item) => {
        map[item.F_CompanyId] = item;
      });

      data.forEach((item) => {
        let parent = map[item.F_ParentId];
        if (parent) {
          (parent.children || (parent.children = [])).push(item);
        } else {
          result.push(item);
        }
      });

      return result;
    },
    // 获取列表数据
    async getDataList(id) {
      this.loading = true;
      const { data: res } = await this.$http.post(
        "roadApi/getCheckProjectFirstList.do",
        {
          companyId: id,
        }
      );

      if (res.errcode == 0) {
        var that = this;

        setTimeout(() => {
          that.loading = false;
          that.tableData5 = this.tranListToTreeData1(
            res.data.checkProjectFirstList
          );
          // return false
          // that.tableData = res.data.checkProjectList;
          that.$nextTick(() => {
            that.$refs.multipleTable.doLayout();
            // el-table加ref="multipleTable"
          });
        }, 200);
      } else {
        this.$message.error(res.msg);
        that.loading = false;
      }
    },
    // 点击当前行
    getRowInfo(e) {
      this.fIds = e.F_Id;
      // this.getCheckList(e.enCode)
    },
    getRowInfo1(e) {
      this.fId = e.F_EnCode;
      // this.getCheckList(e.enCode)
    },

    // 点击当前行变色
    handleCurrentChange(val) {
      this.currentRow = val;
    },
    // 获取页面容器高度
    getHeight() {
      var h = document.documentElement.clientHeight; //获取页面可见高度
      // var w = document.documentElement.clientWidth; //获取页面可见高度
      this.dialogHeight = h * 0.3 + "px";
      this.dialogHeightsa = h * 0.5 + "px";
      this.dialogHeights = h * 0.8 + "px";
    },
    handleNodeClick(data) {
      this.positionName = data.F_ShortName;
      this.getDataList(data.F_CompanyId);
      // 判断编辑框显示隐藏
      if (data.F_Nature == "施工单位") {
        this.edit = true;
      } else {
        this.edit = false;
      }
    },
    handleClick(row, num) {
      this.fId = row.F_Id;
      this.printFile(num);
    },
    openDialog1(row) {
      this.dialogCheckVisible = true;
      this.getCheckList(row.F_EnCode);
    },
    // 获取检测记录---查看
    async getCheckList(id) {
      this.dialogCheckVisible = true;
      this.loadingCheckDialog = true;
      const { data: res } = await this.$http.post(
        "roadApi/getConcreteSampleList.do",
        {
          enCode: id,
        }
      );

      if (res.errcode == 0) {
        this.loadingCheckDialog = false;

        this.CheckList = res.data.concreteSampleList;
      } else {
        this.$message.error(res.msg);
        this.loadingCheckDialog = false;
      }
    },
    openDialog(row) {
      this.projectName = row.F_ProjectName;
      this.getDetails(row.F_Id);
      this.activeIndex = "1";
      this.dialogTableVisibled = true;
    },
    handleSelect(key) {
      this.activeIndex = key;
    },

    async getDetails(id) {
      this.loadingDialog1 = true;
      const { data: res } = await this.$http.post(
        "App/Check/getConcreteChecksampleByFid.do",
        {
          fId: id,
        }
      );

      if (res.errcode == 0) {
        this.loadingDialog1 = false;
        this.formData = res.data.lrCheckConcretesample;
      } else {
        this.$message.error(res.msg);
        this.loadingDialog1 = false;
      }
    },
  },
};
</script>

<style scoped></style>